<?php

namespace app\common\model;

use think\Model;
use app\common\traits\model\TraitModel;

class CashDetail extends Model
{
	use TraitModel;

    protected $autoWriteTimestamp = 'timestamp';
    protected $createTime         = 'created_at';
    protected $updateTime         = 'updated_at';
    protected $table              = 'cash_detail';

    public function getCashLists($query = array(), $order = 'updated_at desc')
    {
        return $this->getInfoList(array_merge($query, ['user_id' => self::getLoginUserInfo('id')]));
    }
    public function getIncomeCashLists($query = array(), $order = 'updated_at desc')
    {
        return $this->getInfoList(array_merge($query, ['user_id' => self::getLoginUserInfo('id'), 'type' => '提现']));
    }
    public function getSpendCashLists($query = array(), $order = 'updated_at desc')
    {
        return $this->getInfoList(array_merge($query, ['user_id' => self::getLoginUserInfo('id'), 'type' => '消费']));
    }






}
